home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
alph100p.zip
/
ALPHA.DOC
< prev
next >
Wrap
Text File
|
1991-11-02
|
47KB
|
1,160 lines
╔══════════════════════════════════════════════════════════╗
║ A L P H A ║
║ A Turbo Pascal ver 6.0 TPU Unit ║
║ ║
║ Copyrighted (C) John H. Gohde, 1991 ║
║ All Rights Reserved ║
║ ║
║ ShareWare licensed for trial use only. ║
╚══════════════════════════════════════════════════════════╝
Page 1 11-02-91
INTRODUCTION
ALPHA is a Turbo Pascal version 6.0 Unit that provides
support for enhanced COLOR TEXT screen operations.
ALPHA provides direct functional replacements for video
statements found in the CRT unit. It is the second of
four units designed to replace the CRT unit. It also
contains over 40 additional new commands, including
support for Video Paging or allows redirection with
COLOR. It contains something of interest for everyone.
ALPHA was designed to make the problem of assuring
compatibility with ALL MONO, CGA, EGA and VGA adapters
as transparent to the programmer as possible
The enclosed ALPHA unit requires Turbo Pascal version
6.0, which is not included.
COPYRIGHT NOTICE
Both the software and its documentation are copyrighted
materials. I reserve all rights to these materials
under United States law and international copyright
conventions which are not expressly granted to the
user. No part of this material may be reproduced or
modified in any way without my prior, expressed written
permission. This document is NOT Public Domain. It is
intended as an informational document for evaluative
purposes and for use by Registered users. This Document
may be copied in whole for that intent only.
DISCLAIMER
I EXPRESSLY DISCLAIM ALL WARRANTIES INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE AND MERCHANTABILITY. YOU USE BOTH THE SOFTWARE
AND DOCUMENTATION AT YOUR OWN RISK!
TRADEMARKS
Turbo Pascal and all other Borland products are
trademarks or registered trademarks of Borland
International, Inc.. Portions of the enclosed Turbo
Pascal unit(s) are Copyrighted (C) 1983,1990 by Borland
International as it/they were compiled with Turbo
Pascal.
Any other brand or products names mentioned in this
document are trademarks or registered trademarks of
their respective holders.
Page 2 11-02-91
SHAREWARE LICENSE
GRANT OF LIMITED LICENSE: You may use one copy of this
software on a single terminal connected to a single
computer for a maximum of 30 days for the sole purpose
of determining suitability for your intended use.
In other words, I am allowing you to use/test my unit
for a thirty day trial period. Use of my unit in any of
your personal programs requires registration. Further,
commercial use of any of my units requires an
additional one time registration fee as a commercial
user.
SHAREWARE NOTICE
ALPHA is NOT public domain software.
For continued use of my unit, EVALUATORS must register!
This is true ShareWare. This means that what you see is
what you get. There is no Registered version! In order
to ask for the absolutely lowest donation possible, I
am not requesting that you pay for the shipping and
handling required by a registered diskette. Hence,
ALPHA is fully functional.
You are required to purchase a copy of this software
for use beyond this 30 day evaluation period. One copy
must be purchased for each computer, cpu, terminal, or
work station.
TEST OF PURCHASE: Possession of this software for more
than 30 days or use of this software on more than one
computer or use in ANY of your programs renders you
liable for the current purchase price for each copy in
use or in your possession. NOTICE: I have provided for
a way of detecting its use in any TP program!!!
HOW TO REGISTER
To register simply fill out the attached registration
form (REGISTER.FRM) and send it with payment to:
John H. Gohde
ALPHA
P O Box 17581
Richmond, VA 23226
Page 3 11-02-91
BACKGROUND INFORMATION
Due to the perceived negative side effects (whether
real or imagined) of Borland's CRT Unit, I decided to
write a functional replacement.
Not having purchased the Run Time Library, I simply
started duplicating the various functions in my own
unit. It soon became apparent, that the CRT unit
actually covered several functional areas. Further, I
realized that each area could also be significantly
enhanced with features not found in Borland's original
unit.
Hence, I actually ended up developing a family of units
to replace Borland's CRT Unit. This family of units are
as follows: WOW, ALPHA, KEY, and MOUSE. The WOW unit
provides the miscellaneous functions with minimal
overhead. The ALPHA unit offers support for simple
non-direct video COLOR TEXT screen operations. The KEY
unit offers support for keyboard operations. The MOUSE
unit offers support for both two and three button mice.
WOW is the first unit of this family, and is required
by ALL my other units, even those not related to the
CRT unit.
The central theme of this family is AlphaNumeric or
TEXT programming using no direct video writes and the
standard InPut/OutPut functions in a manner that is
compatible with multitasking environments.
This family approach allows users to pick and chose the
specific functions that are actually needed in their
programs. As a result, users who do not need all the
functions of all the units can minimize program size.
(Each unit has a small initialization section.) In
addition, Borland's smart linker will remove all unused
code and data from your program. Hence, the increased
functionality of these units will not increase your
program size unless you actually use those functions.
This software file contains the ALPHA unit and a copy
of the required WOW.TPU unit (WOW is also distributed
separately with complete documentation.). (The other
units are packaged separately.) It also contains as
little source code as possible. This package is
intended for those who call themselves Pascal
Programmers rather than just a PC user.
Page 4 11-02-91
This unit does not use OOPs. All the routines are low
level and can be easily incorporated into Objects of
your choice.
This unit is NOT directly comparable to the CRT unit as
it offers a significant number of advanced features,
such as auto clean up, which are NOT provided by
Borland. ALPHA does NOT offer small size as one of its
features. If size is of primary importance then I would
suggest using only my WOW unit.
SOURCE CODE
The source code used in this Unit was written for Turbo
Pascal version 6.0+. Extensive use was made of the new
built-in assembler. As at least 90% of the low-level
code is in the BASM format; support for prior versions
of TP would require a major rewrite of the code (not to
mention my having to buy a legal copy of same). Hence,
I have no plans for supporting prior versions of Turbo
Pascal.
Currently the source code is not available. Frankly, I
would not be able to guarantee at this time a fast
response to any software purchases. Any way, I would
much rather be developing new code than stuffing
envelops!!! Also, if source code was available I would
also be asking for a lot more green.
Once the total package has been distributed nationally,
through several sources, and the companion Windowing
Package has been likewise distributed, I will be in a
good position to determine if the software design has
stabilized, or not. Right now I want to be able to make
design changes as needed. Once, I am satisfied on how
both packages work together, I will start selling
licenses to use the source code( ie, make source code
available).
In addition, please consider the fact that you are
currently using the CRT, DOS, and Printer units without
any source code, either. Lack of code hasn't stopped
you from using the CRT unit; has it? And, if you spent
$190 for the RTL, well you probably would not be
interested in ALPHA anyway.
Nevertheless, this UNIT is supported by me. (see
SUPPORT.DOC). Any bug fixes necessary, will be made
available for download / FREQ from my support Bulletin
Board. Registered Users are entitled to use future
updates to this UNIT necessitated from future versions
of Turbo Pascal; at NO additional charge, pursuant to
our signed license agreement.
Page 5 11-02-91
COLOR AND THE EVILS OF CRT
Users of ALPHA might decide that it does not work with
color the way CRT does. Actually you are comparing
apples with oranges! CRT also does not work with color,
once you turn off CRTs so called evils. Or more
precisely, those users do not really know how CRT
works; or are confused by how color actually functions.
(Run, also, the CRTDEMO and DEMO2 programs.)
There are two so called features/evils in the CRT unit
which some users object to and eventually turn off.
ALPHA does not contain these evils so there is nothing
to turn off. Also if you are NOT going to use these
features, why carry their overhead in your program as
required by the CRT unit?
In all fairness, these features are evils only in
AlphaNumeric, Text, or TUI programming. As these
features are required in graphic or GUI programming,
there usefulness is relative to the type of programming
that you are doing. So if you are primarily interested
in graphics, then ALPHA may not be for you.
Evil number one is Direct Video. CRT contains a
DirectVideo boolean variable. By Default this variable
is set to true with CRT. ALPHA does not use this
variable. This means that CRT is designed for the WRITE
and WRITELN statements to write directly to the screen
memory. ALPHA does NOT write directly to video memory.
Instead characters are displayed using the standard
BIOS output functions. This fact makes ALPHA both
slower and compatible with Multitasking. With todays
faster CPUs / Video Boards, processing speed is not
really as noticeable as it was on the original PC.
However, ALPHA provides for paging which is how
intelligent programmers can make their programs appear
instantaneous using ALPHA. Direct Video writes do not
affect color.
Because CRT writes directly to video memory it also
includes the CheckSnow boolean variable. ALPHA does NOT
use this variable because it is not necessary!!!
Without direct video updates Snow on CGA adapters is
not possible. Hence, your programs need not even check
for this condition.
The second evil involves I/O redirection of the INPUT
and OUTPUT standard text files. With the CRT unit I/O
redirection is no longer possible unless the user adds
code to explicitly assign back standard input and
output. No additional code is needed with ALPHA, since
Page 6 11-02-91
ALPHA uses ONLY standard input and output. So users who
want output to be redirected using the CRT unit; MUST
add extra code which is not required by ALPHA. However,
when output is closed with the CRT unit both the
WRITELN and WRITE statements no longer work with
Color!!! I suggest that you try experimenting with the
CRT unit to verify what happens. Don't just take my
word for it.
Obviously, the same thing happens with ALPHA. So if you
want both color and redirection with the CRT unit what
option do you have? ALPHA provides for color with the
CGA_MODE option and the Echo statements.
COLOR
You have a choice of 16 colors. But, after studying the
subject for a while you should actually STOP thinking
in terms of 16 colors. What you have is two versions of
only eight colors!!! There are eight colors: 0-7 plus a
highlighted version of those same colors. Or you can
call them background (0-7) and foreground (highlighted)
colors.
REDIRECTION vs. Color vs. 16 BACKGROUND COLORS
By Default only eight of those 16 colors are available
for the background. This allows for blinking. The CRT
unit automatically works some magic and enables you to
get 8 background colors on a EGA. With ALPHA you can
get ALL sixteen background colors (even on a CGA), but
by choice only.
First of all you have to chose between blinking and 16
background colors. You can not have both at the same
time. Next you have to decide how you are going to deal
with users using a CGA monitor versus those using
Ega/Vga. This package touts itself as being
multitasking compatible. The problem is that the CGA
can also use 16 background colors but only after a
direct hardware write. This may cause some multitasking
problems. But, the choice is once again yours (use the
MakeAlphaChoice statement). It takes place rather
quickly, so it probably wont cause any problems.
Page 7 11-02-91
MONOCHROME ADAPTERS
If you want your program to function on MONO or MDA
adapters than you must either not use video pages or
code your program so that it processes video pages in
sequence; since MDA adapters only have one video page.
With a MDA monitor installed, ALPHA will force all page
commands to use the first page. Updating video pages
out of sequence will, thus, result in your program
jumping around in a manner not intended by you.
With a MDA adapter installed all color attributes are
filtered by ALPHA to only three values: Normal,
Invisible, and Reverse. This will allow color to work
on a MDA. However, unless you use more than JUST color
in your programs users with MONO monitors will still
not be able to see what is going on. So the use of the
IBM extended character set Box drawing characters to
give some substance to your program screen images; is
highly recommended.
Programmers also have the option of terminating their
program if a MDA is installed with the TerminateOn
command.
VIDEO ADAPTER MODES
BLACK AND WHITE MODE
--------------------
There is no Black and White Mode or MONO mode. If this
is what you want than you really shouldn't be using
ALPHA in your program. My WOW unit will provide for
this mode. But, if you prefer to use ALPHA just be sure
NOT to use the HighVideo, paging, or any of the other
Color statements.
DEFAULT CGA_MODE
----------------
The default mode of ALPHA is set up for the CGA
adapter. This means eight foreground and eight
background colors. Both color and redirection is
possible, at the same time. And, Standard OutPut
remains open.
Page 8 11-02-91
In this mode, any background color values that you code
in your program are filtered out at run-time for users
with a CGA adapter by subtracting 7 from background
color values above seven. For EGA and VGA users these
numbers are not filtered, but the user still sees only
eight background colors (not 16).
If you only want to use 8 background colors then you
can use the Set8Color and Change8 commands and have the
TP compiler catch background color coding errors. These
commands also are faster.
EGA_MODE
--------
You can put your program in EGA mode by selecting it
with the MakeAlphaChoice(EGA_MODE) command (ie, at
start up). This means now that EGA users and above can
now see 16 background colors while CGA users are still
limited to 8 colors. In addition, redirection is no
longer possible as standard OutPut has been closed by
ALPHA.
CGA16_MODE
----------
In this mode all users with a CGA and above adapter can
see 16 background colors. This mode is not recommended
as it requires a direct memory write and may interfere
with some multitasking environments. You would select
this mode with the MakeAlphaChoice(Cga16_Mode) command
at the start of your program.
VGA MODE
--------
ALPHA has no VGA mode. However you can first execute
TextMode(EgaVga) in your program to get 43 rows on your
screen. To get 50 rows follow up with the
SetEgaRows(at50) command. These commands ignore all
adapters below the EGA.
Page 9 11-02-91
WINDOWS
ALPHA does not support windows. After releasing the
complete CRT replacement package, I will develop a
Windowing package that is compatible with ALPHA. But at
present it does not exist. No reason why you couldn't
write you own Windowing routines, however.
But don't confuse windows with pages. They are entirely
two different things. Windows take up valuable CPU RAM
and Video Pages do not!!!
Windows usually cover only part of a screen while a
video page always includes the entire screen.
PAGES
Video Pages use Video Ram which is contained within the
video adapter not the system board. Hence it is another
way to squeeze extra memory out of a computer. Also,
you can use a video page as a means of saving a screen
with only marginal programming overhead. Hence, by
using Video Pages your program code size can actually
be smaller and your program can actually use less user
RAM. (However, in multitasking environments your
program might end up using CPU RAM.) The Video Paging
feature of ALPHA will work in multitasking environments
because no direct video writes are made. ALL screen
updates are performed with the standard BIOS function
calls.
ALPHA FILTERING
---------------
With a MDA or MONO adapter installed all pages above
the first page are filtered out. Therefore, you have to
see to two it that you update date the hidden pages in
sequence, as MDA users will not have hidden pages.
(While a major complication could have been added to
ALPHA to simulate video pages for MDA users that would
have only added to the overhead burden of CGA and above
class users.)
With a CGA adapter installed all pages above the fourth
page are filtered out by subtracting 4 from pages fifth
and above.
Page 10 11-02-91
No check is actually made to determine how many Pages
an installed adapter is capable of supporting. It is
simply assumed that MDA's supports one and CGA's and
above support 4 video pages.
One uses Video pages as a means to develop screens
hidden from a user with the SetPage and PreparePage
commands. Once completed they can be flashed
instantaneously to a user with the SetActivePage
command. Hence you use video pages to speed up the
apparent speed of your program, or in lieu of windows.
Each of the eight video pages has its own cursor
position and cursor shape. However, all the video pages
share the same TextAttr variable.
PROGRAMMER DECISIONS
INSTALLED ADAPTER DECISIONS
---------------------------
If your program must terminate if a user is using a
certain kind of Video Adapter than use the TerminateOn
statement at program start up or write your own
termination routine.
The following decisions are made by the programmer with
the MakeAlphaChoice command.
REDIRECTION AND COLOR DECISIONS
-------------------------------
Must the program have redirection?
A) YES
Either you will use just WOW or you will have
to select the CGA_MODE option. In addition, you
can only use the First Video Page ( ie, don't
use any page commands ) with the Echo commands.
B) NO
Must the program have COLOR?
1. NO
Use either just WOW or select CGA_MODE.
2. YES
Must the program use 16 background colors?
Page 11 11-02-91
A) NO
Select the CGA_MODE option and use the
Set8Colors and Change8 commands.
B) YES
Must installed CGA adapters have 16
background colors?
1. NO
Select the EGA_MODE option and use the
SetColors and Change commands.
2. YES
Select the CGA16_MODE option and use
the SetColors and Change commands.
EXIT PROCEDURE DECISIONS
------------------------
Are you going to write your own Video clean up
procedure?
A) NO
Are you going to write your own Main
Program Exit Procedure? (A Main Program
Exit Procedure is required to leave a
parting comment to your users.)
1. YES
Select the No_MainExit Option.
2. NO
Code your parting user comments.
B) YES
Select the No_AlphaExit option.
Page 12 11-02-91
TEMPLATE.PAS
The attached file called TEMPLATE.PAS contains the
suggested format of all programs using ALPHA. I should
emphasis, however, that any format may be used, as long
as you know what you are doing.
ALPHADEMO.PAS
The attached file called ALPHADEMO.PAS is a sample
program that does not use the CRT unit and illustrates
some of the features of ALPHA as well as document how
some of new commands are also used. I suggest that you
study this program closely.
I have verified that it works on MONO, CGA, and VGA
adapters, as is.
NORMVIDEO - LOWVIDEO - HIGHVIDEO
Indiscriminate use of the LowVideo, HighVideo,
NormVideo statements and changing program modes in
order to high light certain text should be avoided.
Text highlighting can be accomplished either with the
ReversColorXY or Change color statements.
WORKING WITH, NOT AGAINST, ALPHA
The reason why you are going to use ALPHA is because
you like its potential. The ONLY way for you to realize
this potential is for you to work with ALPHA by using
its (and not your own) statements.
Therefore, you should always use an ALPHA command to
update a variable rather than directly updating a
variable (ie, TextAttr and LastPage). In addition, you
should always use one of the Echo Statements rather
than the CRT's WRITE statements. (The CRT uses the RTL
library to work some direct video magic to change how
the WRITE statement functions. ALPHA does not affect
the RTL.)
You must also bit the bullet, so to speak, and write a
few scratch programs to learn how ALPHA works. Merely,
adding ALPHA as just another unit will not guarantee
Page 13 11-02-91
you success; if your program contains its own competing
statements!!! Using ALPHA means that you will no longer
have to write certain routines in your program.
So work with ALPHA, and NOT against it by NOT
substituting your own procedures.
ENUMERATED TYPES
CursorShapes = ( OFF, ON, BLOCK);
----------------------------------
The screen cursor on each of the eight video pages can
be one of these types. You set the cursor with the
CURSOR statement.
Pages = ( FIRST,SECOND,THIRD,FOURTH,FIFTH,SIXTH,SEVENTH,EIGHTH );
-----------------------------------------------------------------
This type lists all the permitted video pages. However,
using pages FIFTH through EIGHTH is not recommended nor
will ALPHA ensure adapter compatibility.
Bkgrd = ( Black8, Blue8, Green8, Cyan8,
Red8, Magenta8, Brown8, White8);
--------------------------------------------
The eight background colors permitted in CGA_MODE. Use
them in conjunction with the special Change8 commands.
EgaRows = ( at43, at50 );
--------------------------
The row options available on an Ega/Vga adapter in
Font8x8 Text mode.
AlphaChoices = ( No_AlphaExit,
No_MainExit,
Cga_Mode,
Ega_Mode,
Cga16_Mode );
------------------------------------
These are the ALPHA options available to the
programmer. Selections are made with the
MakeAlphaChoice command.
VideoCards = ( NOCARD, MDA, CGA, EGA, PGA, VGA, MCGA );
-------------------------------------------------------
These are the types of video adapters reported
installed by ALPHA.
Page 14 11-02-91
CRT VARIABLES SUPPORTED
TextAttr: byte;
---------------
This variable was provided to maintain compatibility
with the CRT unit. While possible to directly alter
this variable, it is not recommended. Doing so will
result in a program that is incompatible with certain
video adapters. There is only one TextAttr that is used
by all eight Video Pages.
Think of it as a scratch pad that holds the last used
Color attribute value. Most statements, but not all,
use it as the default color attribute to be displayed
to the screen. The Change ,ReverseColorXY,
WriteCharOver, and DisplayOver statements ignore it.
LastMode: integer;
------------------
This variable was provided to maintain compatibility
with the CRT unit. Considering the fact that ALPHA has
an Exit Procedure that will restore the original DOS
environment and the CRT unit has the NormVideo
statement, this variable is of no real value.
ADDED PUBLIC VARIABLES
LastPage: Pages;
----------------
The last/current hidden page being updated. It is not
recommended that you directly update this variable.
Access it instead through the SetPage and PreparePage
commands. Your program will start out automatically
using the first video page.
LastProc: Pointer;
------------------
The variable points to the Optional Main Program Exit
Procedure.
Page 15 11-02-91
CRT FUNCTIONS SUPPORTED
Procedure ClrEol;
-----------------
Clears row from cursor position to the end of the line.
Procedure DelLine;
------------------
Deletes the row under the cursor.
Procedure HighVideo;
--------------------
Filters the current foreground value of TextAttr so
that 8 is add to all foregrounds less than eight.
Procedure InsLine;
------------------
Inserts a blank row above the cursor.
Procedure LowVideo;
-------------------
Turns HighVideo off.
Procedure NormVideo;
--------------------
Restores the TextAttr variable to the Starting Color
Attribute value.
Procedure TextBackground( Color: byte);
---------------------------------------
Changes the background color value stored in the
variable TextAttr. You would use this variable if you
were planning to Display a new text value and only
wanted to have a different background color.
Procedure TextColor( Color: byte);
----------------------------------
Changes the foreground color value stored in the
variable TextAttr. You would use this variable if you
were planning to Display a new text value and only
wanted to have a different foreground color.
Page 16 11-02-91
Procedure TextMode( Mode: integer);
-----------------------------------
Changes the current textmode. Use the standard CRT text
mode constants.
Function WhereX: byte;
-----------------------
Returns the row position of the cursor.
Function WhereY: byte;
-----------------------
Returns the column position of the cursor.
Page 17 11-02-91
ADDED FUNCTIONS
Following the TextAttr method used in the CRT unit,
color is selected separately rather than on every
command. Likewise, ALPHA uses the same method both for
color attributes and for video pages.
All commands are in reference to the value of LastPage
except for SetActivePage and GetActivePage. Therefore,
LastPage must be set to the value of GetActivePage if
you want to reference values on the displayed screen.
Procedure AltPrintScr;
----------------------
For Ega/Vga adapters it selects an alternate
print-screen routine that works properly if the screen
length is not 25 rows. The ROM BIOS default
print-screen routines always prints 25 lines.
Procedure Change8ColorXY( X,Y,Len,Foreground: Byte;
Background: Bkgrd);
---------------------------------------------------
A special CGA_MODE version of ChangeColor that uses the
compiler to catch background color errors. It is also
faster.
Procedure Change8BackgroundXY( X,Y,Len: byte; Color: Bkgrd);
------------------------------------------------------------
A special CGA_MODE version of ChangeBackgroundXY that
uses the compiler to catch background color errors. It
is also faster.
Procedure ChangeColorXY( X,Y,Len,Foreground, Background: byte);
---------------------------------------------------------------
Retains text values but changes both foreground and
background color at screen position X,Y for a length of
LEN.
Procedure ChangeBackgroundXY( X,Y,Len,Color: byte);
---------------------------------------------------
Retains text values but changes ONLY background color
at screen position X,Y for a length of LEN.
Page 18 11-02-91
Procedure ChangeForegroundXY( X,Y,Len,Color: byte);
---------------------------------------------------
Retains text values but changes ONLY foreground color
at screen position X,Y for a length of LEN.
Procedure Cursor( Shape: CursorShapes);
---------------------------------------
Turns the cursor ON, OFF, or selects a BLOCK cursor.
Procedure Echo( S: string);
---------------------------
Displays the string S on the screen at the cursor
position while echoing the string to standard output.
This command provides for redirection.
Procedure EchoLn( S: string);
-----------------------------
Displays the string S on the screen at the cursor
position while echoing the string to standard output.
And, moves the cursor to the beginning position of the
following row. This command provides for redirection.
Procedure Display( X,Y: byte; S: string);
-----------------------------------------
Displays the string S on the screen at position X,Y.
Procedure DisplayOver( X,Y: byte; S: string);
---------------------------------------------
Displays the S on the screen at position X,Y while using
the current screen colors at those positions.
Procedure EndofLine;
--------------------
Positions cursor on the last column of the current row.
Procedure FillPage( Ch: Char);
------------------------------
Fills the screen with character CH.
Function GetActivePage: Pages;
-------------------------------
Returns the page currently being displayed on screen.
Page 19 11-02-91
Function GetBackGround( ColorAttr: byte): byte;
------------------------------------------------
Returns the background color of a color attribute byte.
Function GetForeGround( ColorAttr: byte): byte;
------------------------------------------------
Returns the foreground color of a color attribute byte.
Procedure GetBoth( var ColorAttr: byte; CH: char);
--------------------------------------------------
Enables you to get both the color attribute and the
character in one command.
Function GetColorAttr: byte;
-----------------------------
Returns the color attribute byte at the cursor
position.
Function GetChar: char;
------------------------
Returns the character at the cursor position.
Procedure GotoX( X: byte);
--------------------------
Moves cursor to Row X while remaining in the same
column.
Procedure GotoY( Y: byte);
--------------------------
Moves the cursor to Column Y while remaining in the
same row.
Procedure Home;
---------------
Moves the cursor to the starting column while remaining
in the same row.
Procedure MakeAlphaChoice( Text: TextChoices);
----------------------------------------------
How the programmer can select the various ALPHA
options.
Page 20 11-02-91
Function MaxCols: byte;
------------------------
Returns the number of columns on the screen.
Function MaxRows: byte;
------------------------
Returns the number of rows on the screen.
Procedure Prepare8Page( P: Pages;C: CursorShapes;
Foreground: byte; Background: Bkgrd);
-------------------------------------------------------
A high level routine that performs a number of common
procedures. It executes SetPage, Cursor, Set8Color, and
Cls using the CRT_MODE special 8 option.
Procedure PreparePage( P: Pages;C: CursorShapes; Foreground,
Background: byte);
------------------------------------------------------------
A high level routine that performs a number of common
procedures. It executes SetPage, Cursor, SetColor, and
Cls.
Procedure ReverseColorXY( X,Y,Len: byte);
-----------------------------------------
Swaps the color attribute value of foreground and
background color starting at screen position X,Y for
length LEN. It does not change TextAttr.
Procedure Set8Color( Foreground: byte; Background: Bkgrd);
----------------------------------------------------------
A special CGA_MODE version of SetColor that uses the
compiler to catch background color errors. It is also
faster.
Procedure SetColor( Foreground, Background: byte);
--------------------------------------------------
Changes both the foreground and background colors of
the TextAttr. Avoids the need for using TextColor and
TextBackground sequentially.
Procedure SetActivePage( Num: Pages);
-------------------------------------
Displays the video page Num on the screen.
Procedure SetBorder( Color: byte);
----------------------------------
Changes the Border color on all CGA, EGA, and VGA
monitors.
Page 21 11-02-91
Procedure SetEgaLines( Num: VgaRows);
-------------------------------------
Sets the Ega scan lines on Ega and above monitors.
Procedure SetPage( P: Pages);
-----------------------------
Allows you to write to the hidden page P. Use this
command instead of directly changing the LastPage
Variable as it works with MONO and CGA adapters.
MONO adapters are forced to used ONLY the first page
and CGA adapters for pages over four have the number
4 subtracted from P.
Procedure TerminateOn( V: VideoCards);
--------------------------------------
A built in routine that terminates the program if the
installed video adapter is equal to V, and displays a
message stating that the succeeding VideoCard is
required.
Function VideoAdapter: VideoCards;
-----------------------------------
Returns the installed video adapter.
Procedure WhereXY( var X,Y: byte);
----------------------------------
Returns the X,Y screen position of the cursor.
Procedure WriteCharOver( Ch: char; Num: word);
----------------------------------------------
Writes the Character CH at the current cursor position
Num number of times using the current screen colors at
those positions.
Page 22 11-02-91
BONUS STRING FUNCTIONS
Function Color2Str( Color: byte): str16;
-----------------------------------------
Converts a color constant into a color name string.
Function Int2Str( Num: longint; Width: byte): str80;
-----------------------------------------------------
Converts a whole number into a string of WIDTH length.
Function Real2Str( Num: real; Width,Decimals: byte): str80;
-------------------------------------------------------------
Converts a real number into a string with Decimals of
WIDTH length.
Function Pages2Str( P: Pages): str7;
-------------------------------------
Converts the enumerated type Pages into a string
value.
Function VideoAdapter2Str( V: Videocards): Str4;
-------------------------------------------------
Converts the VideoCards type into a string value.
Page 23 11-02-91
PRODUCT SUPPORT
This product is supported by the author via a product
support echo on a 24 hour a day BBS. First, time
callers may download the latest versions of my
products.
You can contact me by data phone (8N1 1200/2400 BAUD)
at:
╔═══════════════════════════════╗
║ The FreeBoard BBS ║
║ (804)744-0744 ║
║ Richmond, Va. ║
╚═══════════════════════════════╝
The FreeBoard BBS is a multi-node RBBS-PC board on the
Fido Net Work with over 400 MEG's of files.
And, of course, you can ask your SYSOP to FREQ this or
any other files from this board with the following
info:
1:264/212,The_FreeBoard_BBS,Midlothian_VA,Bill_Hunter,
1-804-744-0797,9600,CM,XX,LO,HST
The support echo is called LZE-WC. You arrive at this
conference from the MAIN menu by joining it as follows:
J
LZE-WC
The author may also be contacted by writing to:
JOHN GOHDE
ALPHA
P O BOX 17581
RICHMOND, VA 23226-7581
If you expect a response, be sure to include a self
addressed and stamped return envelop!
Page 24 11-02-91
UPDATE HISTORY
VERSION 1.00 -- originally released on 11-02-91